import java.util.Scanner;

public class Test9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int c = scanner.nextInt();
        boolean found = false;

        for (int a = 1; a * a <= c; a++) {
            int bSquared = c - a * a;
            int b = (int) Math.sqrt(bSquared);
            if (b * b == bSquared) {
                System.out.println(a + "," + b);
                found = true;
                break;
            }
        }

        if (!found) {
            System.out.println(-1);
        }

        scanner.close();
    }
}